package com.maiji.cloud.entities.shopingmall;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.gitee.sunchenbin.mybatis.actable.annotation.Column;
import com.gitee.sunchenbin.mybatis.actable.annotation.Table;
import com.gitee.sunchenbin.mybatis.actable.constants.MySqlTypeConstant;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import java.util.Date;

/**
 *  购物车记录
 */
@NoArgsConstructor
@Data
@Accessors(chain=true)
@Table(name = "shoping_cart")
public class ShopingCart {

    @TableId
    @Column(name = "uu_id", type = MySqlTypeConstant.VARCHAR, length = 50, isKey = true)
    private String uuId; // 购物记录ID

    @Column(name = "user_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String userId; // 所属用户ID

    @Column(name = "goods_id", type = MySqlTypeConstant.VARCHAR, length = 50)
    private String goodsId; // 商品ID

    @Column(name = "purchase_quantity", type = MySqlTypeConstant.INT, length = 2)
    private Integer purchaseQuantity; // 购买数量

    @Column(name = "original_payable", type = MySqlTypeConstant.DOUBLE, length = 8, decimalLength = 2)
    private Double originalPayable;  // 原应付款

    @Column(name = "present_payable", type = MySqlTypeConstant.DOUBLE, length = 8, decimalLength = 2)
    private Double presentPayable;  // 现应付款

    @Column(name = "weight_total", type = MySqlTypeConstant.INT, length = 2)
    private Integer weightTotal; // 物流总重（克）

    @Column(name = "deal_date", type = MySqlTypeConstant.DATETIME)
    private Date dealDate; // 成交时间

    @Column(name = "add_date", type = MySqlTypeConstant.DATETIME)
    private Date addDate; // 加入购物车时间

    @Column(name = "update_date", type = MySqlTypeConstant.DATETIME)
    private Date updateDate; // 最后修改时间

    @Column(name = "chosen", type = MySqlTypeConstant.BIT)
    private Boolean chosen; // 用户是否选择

    @Column(name = "status", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer status; //状态：0-待提交订单/待付款, 1-已提交订单/已付款

    @Column(name = "add_auto", type = MySqlTypeConstant.BIT)
    private Boolean addAuto; // 是否为单品购买初始化订单自动添加

    @TableLogic
    @Column(name = "is_del", type = MySqlTypeConstant.INT, length = 1, defaultValue = "0")
    private Integer isDel; // 是否逻辑删除，1是，0否

}
